/*
 *   Copyright (c) 2010-2022, SIUFUNG
 */
package net.siufung.market.base.dict.controller.model.dict;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.extern.slf4j.Slf4j;
import net.siufung.core.utils.CopyUtil;
import net.siufung.market.base.dict.mapper.entity.Dict;

import java.io.Serializable;

/**
 * <p>
 * 字典数据 默认数据传参对象
 * </p>
 * @author 陈建峰
 * @since 2022-07-08 15:30:15
 */
@Slf4j
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="DictDto", description="字典数据默认数据传输对象")
public class DictDto implements Serializable {

    private static final long serialVersionUID = -7030924626490147525L;

    /**
     * 字典id
     */
    @ApiModelProperty(value = "字典id")
    private Integer id;

    /**
     * 字典编码
     */
    @ApiModelProperty(value = "字典编码")
    private String dictCode;

    /**
     * 字典值
     */
    @ApiModelProperty(value = "字典值")
    private String dictValue;

    /**
     * 类型
     */
    @ApiModelProperty(value = "类型Id")
    private Integer dictTypeId;

    /**
     * 类型
     */
    @ApiModelProperty(value = "类型编码")
    private String dictTypeCode;

    /**
     * 备注
     */
    @ApiModelProperty(value = "备注")
    private String description;

    /**
     * 租户
     */
    @ApiModelProperty(value = "租户")
    private String tenantId;

    /**
     * 数据标识
     */
    @ApiModelProperty(value = "数据标识")
    private Boolean deleted;

    /**
     * 转化成数据库实体
     * @return Dict
     */
    public Dict to(){
        Dict dict = new Dict();
        CopyUtil.copyProperties(this, dict);
        return dict;
    }
}